#include <forward_list>
#include <iostream>
#include <string>
#include <vector>
using namespace std;

#define PRINT(STRING)                                                          \
  std::cout << "error: " << (STRING) << "  " << __FILE__ << std::endl;
// #define PRINT(STRING, STRING2)                                                 \
//   std::cout << "error: " << (STRING) << " " << (STRING2) << std::endl;

// #define SOFT_CHECK

#ifdef SOFT_CHECK
#define USE_SOFT_ERROR_RETURN true
#else
#define USE_SOFT_ERROR_RETURN false
#endif

#define ERROR_RETURN(EH5_ERR_TYPE)                                             \
  if constexpr (USE_SOFT_ERROR_RETURN) {                                       \
    return EH5_ERR_TYPE;                                                       \
  } else {                                                                     \
    exit(EXIT_FAILURE);                                                        \
  }

#define ERROR_RETURN_M(EH5_ERR_TYPE, MESSAGE)                                  \
  {                                                                            \
    std::cerr << "error: " << MESSAGE << std::endl;                            \
    ERROR_RETURN(EH5_ERR_TYPE)                                                 \
  }

#define ERROR_CHECK(EXPR, MESSAGE, ERR_TAG)                                    \
  if (!(EXPR)) {                                                               \
    std::cerr << __FILE__ << ": " << __FUNCTION__ << ": \"" << #EXPR           \
              << "\" check failed!";                                           \
    ERROR_RETURN_M(ERR_TAG, MESSAGE)                                           \
  }

int main() {

  PRINT("  hello world! dffffff __FILE__ ")
  int tmp{2};
  ERROR_CHECK(tmp != 2, "", 0)
  return 0;
}